ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Newt_Base Class Reference

The base class for all newts containing common attributes and behaviour for descendent types. More...

#include <Newt.h>

Inheritance diagram for Newt_Base:
TAnimal TALMaSSObject Newt_Egg Newt_Juvenile Newt_Larva Newt_Adult Newt_Female Newt_Male

Public Member Functions

 Newt_Base (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Newt constructor. More...
 
void Init (vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Intitialise object. More...
 
void ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 ReInit for object pool. More...
 
 ~Newt_Base ()
 Newt destructor. More...
 
virtual int WhatState ()
 Returns the state number for display purposes. More...
 
TTypeOfNewtState st_Develop (void)
 Behavioural state development - does nothing in the base class. More...
 
TTypeOfNewtState st_Movement (void)
 Behavioural state movement - does nothing in the base class. More...
 
void st_Dying (void)
 Behavioural state dying. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
virtual void Step (void)
 The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'. More...
 
virtual void EndStep (void)
 The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
unsigned GetAge ()
 A typical interface function - this one returns the Age as an unsigned integer. More...
 
void SetAge (unsigned a_age)
 A typical interface function - this one sets the Age as an unsigned integer. More...
 
unsigned GetHomePond ()
 A typical interface function - this one returns the home pond reference as an unsigned integer. More...
 
void SetHomePond (unsigned a_pond)
 A typical interface function - this one sets the home pond reference as an unsigned integer. More...
 
void InternalPesticideHandlingAndResponse (double)
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Static Public Attributes

static double m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value()
 
static double m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value()
 
static double m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value()
 
static double m_EggMortalityChance = cfg_NewtEggMortalityChance.value()
 
static double m_JuvenileMortalityChance = 0.0
 
static double m_AdultMortalityChance = 0.0
 
static bool m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value()
 Flags to record whether we are in pesticide testing mode. More...
 
static bool m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value()
 
static bool m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value()
 

Protected Attributes

TTypeOfNewtState m_CurrentNewtState
 Variable to record current behavioural state. More...
 
unsigned m_Age
 
vector< unsigned > m_pondlist
 
Newt_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
double m_body_burden
 The current PPP body burden for use in pesticide testing mode. More...
 
bool m_reproductiveinhibition
 A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent classes) More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Detailed Description

The base class for all newts containing common attributes and behaviour for descendent types.

Constructor & Destructor Documentation

◆ Newt_Base()

Newt_Base::Newt_Base ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
bool  a_reproinhib 
)

Newt constructor.

59  : TAnimal(a_x, a_y, a_L) {
60  // Assign the pointer to the population manager
61  Init(a_pond, a_NPM, a_reproinhib);
62 }
void Init(vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib)
Intitialise object.
Definition: Newt.cpp:72
TAnimal(int x, int y, Landscape *L)
Definition: PopulationManager.cpp:1367

References Init().

◆ ~Newt_Base()

Newt_Base::~Newt_Base ( void  )

Newt destructor.

82 {
83  ;
84 }

Member Function Documentation

◆ BeginStep()

virtual void Newt_Base::BeginStep ( void  )
inlinevirtual

The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep.

Reimplemented from TAnimal.

Reimplemented in Newt_Male.

149  {
150  ;
151  }// NB this is not used in the Newt_Base code

◆ EndStep()

virtual void Newt_Base::EndStep ( void  )
inlinevirtual

The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep.

Reimplemented from TAnimal.

157  {
158  ;
159  }// NB this is not used in the Newt_Base code

◆ GetAge()

unsigned Newt_Base::GetAge ( void  )
inline

A typical interface function - this one returns the Age as an unsigned integer.

161  {
162  return m_Age;
163  }
unsigned m_Age
Definition: Newt.h:115

References m_Age.

◆ GetHomePond()

unsigned Newt_Base::GetHomePond ( )
inline

A typical interface function - this one returns the home pond reference as an unsigned integer.

169  {
170  return m_pondlist[ 0 ];
171  }
vector< unsigned > m_pondlist
Definition: Newt.h:117

References m_pondlist.

◆ Init()

void Newt_Base::Init ( vector< unsigned >  a_pond,
Newt_Population_Manager a_NPM,
bool  a_reproinhib 
)

Intitialise object.

72  {
73  m_OurPopulationManager = a_NPM;
75  m_Age = 0;
76  m_pondlist = a_pond; // the home pond is added here
77  m_body_burden = 0.0;
78  m_reproductiveinhibition = a_reproinhib;
79 }
@ toNewts_InitialState
Definition: Newt.h:66
TTypeOfNewtState m_CurrentNewtState
Variable to record current behavioural state.
Definition: Newt.h:113
bool m_reproductiveinhibition
A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent ...
Definition: Newt.h:123
Newt_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Newt.h:119
double m_body_burden
The current PPP body burden for use in pesticide testing mode.
Definition: Newt.h:121

References m_Age, m_body_burden, m_CurrentNewtState, m_OurPopulationManager, m_pondlist, m_reproductiveinhibition, and toNewts_InitialState.

Referenced by Newt_Base(), and ReInit().

◆ InternalPesticideHandlingAndResponse()

void Newt_Base::InternalPesticideHandlingAndResponse ( double  )
inline

For handlng of class-specific pesticide effects.

177 {};

◆ ReInit()

void Newt_Base::ReInit ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
bool  a_reproinhib 
)

ReInit for object pool.

65  {
66  TAnimal::ReinitialiseObject(a_x, a_y, a_L);
67  // Assign the pointer to the population manager
68  Init(a_pond, a_NPM, a_reproinhib);
69 }
virtual void ReinitialiseObject()
Used to re-use an object - must be implemented in descendent classes.
Definition: PopulationManager.h:143

References Init(), and TALMaSSObject::ReinitialiseObject().

Referenced by Newt_Egg::ReInit(), and Newt_Juvenile::ReInit().

◆ SetAge()

void Newt_Base::SetAge ( unsigned  a_age)
inline

A typical interface function - this one sets the Age as an unsigned integer.

165  {
166  m_Age = a_age;
167  }

References m_Age.

Referenced by Newt_Population_Manager::CreateObjects().

◆ SetHomePond()

void Newt_Base::SetHomePond ( unsigned  a_pond)
inline

A typical interface function - this one sets the home pond reference as an unsigned integer.

173  {
174  m_pondlist[ 0 ] = a_pond;
175  }

References m_pondlist.

◆ st_Develop()

TTypeOfNewtState Newt_Base::st_Develop ( void  )
inline

Behavioural state development - does nothing in the base class.

139  {
140  return TTypeOfNewtState(-1);
141  }
TTypeOfNewtState
Newt behavioural states.
Definition: Newt.h:61

◆ st_Dying()

void Newt_Base::st_Dying ( void  )

Behavioural state dying.

87  {
88  m_CurrentStateNo = -1; // this will kill the animal object and free up space
89 }
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References TALMaSSObject::m_CurrentStateNo.

Referenced by Newt_Egg::Step(), Newt_Larva::Step(), Newt_Juvenile::Step(), Newt_Male::Step(), and Newt_Female::Step().

◆ st_Movement()

TTypeOfNewtState Newt_Base::st_Movement ( void  )
inline

Behavioural state movement - does nothing in the base class.

143  {
144  return TTypeOfNewtState(-1);
145  }

◆ Step()

virtual void Newt_Base::Step ( void  )
inlinevirtual

The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'.

Reimplemented from TAnimal.

Reimplemented in Newt_Female, Newt_Male, Newt_Juvenile, Newt_Larva, and Newt_Egg.

153  {
154  ;
155  }

◆ WhatState()

virtual int Newt_Base::WhatState ( )
inlinevirtual

Returns the state number for display purposes.

Reimplemented from TAnimal.

135  {
136  return m_CurrentNewtState;
137  }

References m_CurrentNewtState.

Member Data Documentation

◆ m_AdultMortalityChance

double Newt_Base::m_AdultMortalityChance = 0.0
static

◆ m_Age

◆ m_body_burden

◆ m_CurrentNewtState

◆ m_EggDevelopmentDDParameter

double Newt_Base::m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value()
static

◆ m_EggDevelopmentDDTotal

double Newt_Base::m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value()
static

ALL newts have to know which pond they were born in, as well as their age, state, and the information inherited from TAnimal. Newt_Base also defines static members used by all descendent classes. These are parameter values and therefore constants for a single run.
Attributes introduced here are:

  • m_Age the age of the newt in days from egg laying
  • m_pondlist which is a list of the ponds that the newt has located since leaving the pond of birth

Referenced by Newt_Population_Manager::Newt_Population_Manager(), and Newt_Egg::st_Develop().

◆ m_EggMortalityChance

double Newt_Base::m_EggMortalityChance = cfg_NewtEggMortalityChance.value()
static

◆ m_JuvenileDevelopmentSize

double Newt_Base::m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value()
static

◆ m_JuvenileMortalityChance

double Newt_Base::m_JuvenileMortalityChance = 0.0
static

◆ m_OurPopulationManager

Newt_Population_Manager* Newt_Base::m_OurPopulationManager
protected

◆ m_pondlist

vector<unsigned> Newt_Base::m_pondlist
protected

/brief The list of pond locations found by the newt, the first value being the pond of birth - NB this holds the index to the polygon array

Referenced by GetHomePond(), Init(), Newt_Juvenile::NewtMoveQuality(), SetHomePond(), Newt_Adult::SetInPond(), Newt_Egg::st_Develop(), Newt_Larva::st_Develop(), Newt_Adult::st_Migrate(), Newt_Egg::st_NextStage(), Newt_Larva::st_NextStage(), and Newt_Juvenile::st_NextStage().

◆ m_reproductiveinhibition

bool Newt_Base::m_reproductiveinhibition
protected

◆ m_test_pesticide_egg

bool Newt_Base::m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value()
static

Flags to record whether we are in pesticide testing mode.

Referenced by Newt_Population_Manager::Newt_Population_Manager(), and Newt_Egg::st_Develop().

◆ m_test_pesticide_larva

bool Newt_Base::m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value()
static

◆ m_test_pesticide_terrestrial

bool Newt_Base::m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value()
static

The documentation for this class was generated from the following files: